473,544 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vertical alignment on ul/li bullet image

hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?

Thanks, Gabi.

Aug 2 '06 #1
4 41780
Rik
Gabriella wrote:
hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?
I'm not sure wether this it's possible to set the position in the different
browsers. I haven't found a method for this.

Possible workaround (untested):
ul {
margin: 0px;
padding: 0px;
}
li{
list-style-type: none;
margin: 0.3em 0 0 0;
padding-left: 10px; /* or whatever you need for you image */
background-image: url(/Images/arrow.gif);
background-position: left top; /* or replace 'top' with the appropriate
em value */
background-repeat: no-repeat;
}

Grtz,
--
Rik Wasmus
Aug 2 '06 #2
On 2 Aug 2006 00:40:47 -0700, "Gabriella" <fr********@yah oo.com>
wrote:
>hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?

Thanks, Gabi.
Hi Gabi,

I wrestled with the same problem and my solution (modified for your
example) was:

ul {
list-style-type: none;
padding: 0em;
margin: 0em;
}

ul li {
background-image: url(Images/arrow.gif);
background-repeat: no-repeat;
background-position: 0em .4em;
padding-left: 1em;
}

Note that the image is set to the li not the ul.

Hope this is a guide for you!!

Andrew.

--

Andrew
http://www.andrews-corner.org/
Aug 2 '06 #3
Thanks, it solved the problem, but created a new one...
Now, when trying to add dynamically an entry to the list, using the
following code:

var myList = document.getEle mentById("my-list");
var newLiElement = document.create Element('li');
newLiElement.id = "new-entry";
myList.appendCh ild(newLiElemen t);

var innerHTML = "&nbsp;<a href="...">[remove from
list]</a>"
document.getEle mentById("new-entry").innerHT ML = innerHTML;

A new entry (new li element) is created but WITHOUT the bullet image
(the arrow.gif).
Before, it did add the bullet image.
Why did it disappear?

Thanks again, Gabi

Aug 2 '06 #4
On 2 Aug 2006 14:20:30 -0700, "Gabriella" <fr********@yah oo.com>
wrote:
>Thanks, it solved the problem, but created a new one...
Now, when trying to add dynamically an entry to the list, using the
following code:

var myList = document.getEle mentById("my-list");
var newLiElement = document.create Element('li');
newLiElement.id = "new-entry";
myList.appendCh ild(newLiElemen t);

var innerHTML = "&nbsp;<a href="...">[remove from
list]</a>"
document.getEle mentById("new-entry").innerHT ML = innerHTML;

A new entry (new li element) is created but WITHOUT the bullet image
(the arrow.gif).
Before, it did add the bullet image.
Why did it disappear?

Thanks again, Gabi
Hi Gabi,

So quickly I get out of my depth! Sigh........... You will need
someone cleverer than me for this one.

Sorry,

Andrew
--

Andrew
http://www.andrews-corner.org/
Aug 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7097
by: Nikolaos Giannopoulos | last post by:
I have a paragraph and simply want a bullet image to appear at the start of the paragraph text. I tried the following html: <p><span class="dot"></span>some text</p> as seen here: http://solmar.ca/temp8/test1.html Observed: IE5 and Moz 1.3 works - IE 6.0 and Opera 6.05 does not work I then assumed that maybe because there is nothing...
8
30887
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
3
4276
by: Frank Wheeler | last post by:
Why am I unable to attain proper vertical alignment between a DIV and a TABLE here: http://www.whbvillage.com/agenda-archives/agendex.html The DIV is coded: <DIV style="float: left; background: transparent; color: #000099;
3
15645
by: cbjewelz | last post by:
hey I've been suffering from several float problems. I want a Title on the left to be aligned vertically with several links on the right. However with my code the Title is lower than the links. I've tried putting display: inline in every place but to no avail. Here is my code:<style type="text/css"> /* =INITIAL /* Neutralize styling: ...
2
6374
by: Nik | last post by:
I have a simplified version of my image gallery at: http://www.niksally.f2s.com/upload/gallery/mixed_gallery.html Essentially, the format of the html is an in-line list: <ul> <li><img></li> <li><img></li> </ul>
11
19182
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
8
3520
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag: body { font-family: Trebuchet MS, Arial; cursor : default; background:#000000 url("Images/long-template.jpg");...
3
3489
by: vunet | last post by:
When I use image as a bullet within LI element I have different image positioning results in Firefox and IE6. IE6 puts the image on top and far from left LI's border. Firefox puts it nicely in the middle and very close to left border. How do I control bullet image positioning? Please advise a nice hack. Thanks
0
1463
by: balistersharma | last post by:
How can set vertical alignment with RadioButtonList .so that the RadioButtonList and text show in the same alignment. I have used following syntax but this is not work as my requirement. vertical-align:top; or RadioButtonList label { vertical-align:top; }
0
7376
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7785
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5935
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5310
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4932
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
679
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.